package com.lin.filegraph.utils.parser.astvisitor;

import com.lin.filegraph.utils.parser.astvisitor.EnumConstantVisitor;
import com.lin.filegraph.utils.parser.astvisitor.FieldVisitor;
import com.lin.filegraph.utils.parser.astvisitor.MethodVisitor;
import com.lin.filegraph.utils.parser.node.JEnumNode;
import com.lin.filegraph.utils.parser.node.JTypeNode;

/**
 * @description:
 * @author: linhuaixu
 * @time: 2023/5/18 14:09
 */
public class TypeContentVisitor {
    JTypeNode typeNode = null;

    public TypeContentVisitor(JTypeNode node) {
        // TODO Auto-generated constructor stub
        this.typeNode = node;
    }

    public void visitTypeContent() {
        // ע��EnumNode����Ҳ��ClassNode������
        FieldVisitor fieldVisitor = new FieldVisitor(typeNode);
        fieldVisitor.traverseFields();
        MethodVisitor methodVisitor = new MethodVisitor(typeNode);
        methodVisitor.traverseMethods();
        if (typeNode instanceof JEnumNode) {
            EnumConstantVisitor enumConstantVisitor = new EnumConstantVisitor((JEnumNode) typeNode);
            enumConstantVisitor.traverseEnumConstants();
        }
    }
}
